package com.bawei.caohao20240805.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.bawei.comm.model.bean.RenBean
import com.bawei.comm.model.util.HttpUtils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import retrofit2.http.Header
import retrofit2.http.Query

/**
 * 作者: 曹浩
 * 时间: 2024/8/6
 * 功能描述:
 */
class ShiViewModel :ViewModel(){
    val rendata=MutableLiveData<RenBean>()
    fun getren(
        @Header("userId")userId:Int,
        @Header("sessionId")sessionId:String,
        @Query("actualName")actualName:String,
        @Query("sex")sex:Int,
        @Query("birthday")birthday:String,
        @Query("address")address:String,
        @Query("idNumber")idNumber:String,
        @Query("office")office:String,
        @Query("expireDate")expireDate:String,
    ){
        HttpUtils.httpUtils.server.getren(userId, sessionId, actualName, sex, birthday, address, idNumber, office, expireDate)
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe {
                rendata.value=it
            }
    }
}